//
//  ListView.swift
//  demo
//
//  Created by raymond on 2022/5/11.
//

import SwiftUI

struct Ocean: Identifiable {
  let id = UUID()
  let name: String
  let desc: String
}

private var oceans = [
  Ocean(name: "Pacific", desc: "pacific desc"),
  Ocean(name: "Atlantic", desc: "atl desc"),
  Ocean(name: "Indian", desc: "indian desc"),
  Ocean(name: "Southern", desc: "south desc"),
  Ocean(name: "Arctic", desc: "arctic desc")
]

struct ListView: View {
    var body: some View {
      ScrollView {
        List(oceans){ ocean in
          Text(ocean.name)
        }
      }
    }
}

struct ListView_Previews: PreviewProvider {
    static var previews: some View {
        ListView()
    }
}
